/*
 * @Author: ChunLai
 * @Date: 2022-03-10 19:14:38
 * @LastEditTime: 2022-08-01 10:30:25
 * @Description: 
 * @FilePath: \3.newInsure\src\utils\pdfh5.js
 */
export const pdfJs = (callback) => {
  let link = document.createElement("link");
  link.href = "https://mschn-pro.oss-cn-beijing.aliyuncs.com/css/pdfh5.css";
  link.rel = "stylesheet"
  let head = document.getElementsByTagName("head")[0];
  head.appendChild(link);

  let script3 = document.createElement('script');
  script3.type = 'text/javascript';
  script3.src = 'https://mschn-pro.oss-cn-beijing.aliyuncs.com/js/pdfnew.js';
  document.body.appendChild(script3);
  let activeJs = [script3]
  for (let i = 0; i < activeJs.length; i++) {
    (function (i) {
      activeJs[i].onload = activeJs[i].onreadystatechange = function () {
        if (!this.readyState || this.readyState == 'loaded' || this.readyState == 'complete') {
          if (callback) {
            callback(i)
          }
          console.log('加载好了' + activeJs[i])
        }
      };
    })(i)
  }


}